package chatRoom2;

import java.net.DatagramSocket;
import java.net.SocketException;
import java.util.Scanner;

public class Room {
    public static void main(String[] args) throws SocketException {
        Scanner in=new Scanner(System.in);
        System.out.println("请输入当前端口号");
        int sendPort=in.nextInt();
        System.out.println("请输入接收端口号");
        int receivePort=in.nextInt();
        System.out.println("聊天室启动成功");

        DatagramSocket socket=new DatagramSocket(sendPort);
      Thread sendThread=new Thread(new Sender(socket,receivePort),"发送线程");
Thread receiveThread=new Thread(new Receiver(socket),"接收线程");
sendThread.start();
receiveThread.start();
    }
}
